package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 日库数据表，用于日常监测分析
 * @TableName daily_data
 */
@TableName(value ="daily_data")
@Data
public class DailyData {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 结关日期
     */
    private Date customsClearanceDate;

    /**
     * 商品ID
     */
    private Long commodityId;

    /**
     * 商品名称
     */
    private String commodityName;

    /**
     * 商品编码
     */
    private String commodityCode;

    /**
     * 申报海关ID
     */
    private Integer declareCustomsId;

    /**
     * 进出境海关ID
     */
    private Integer entryExitCustomsId;

    /**
     * 地区ID
     */
    private Integer regionId;

    /**
     * 国别ID
     */
    private Integer countryId;

    /**
     * 企业ID
     */
    private Long enterpriseId;

    /**
     * 贸易方式ID
     */
    private Integer tradeModeId;

    /**
     * 金额
     */
    private BigDecimal amount;

    /**
     * 数量
     */
    private BigDecimal quantity;

    /**
     * 币制
     */
    private String currencyType;

    /**
     * 数据类型(I:进口,E:出口,T:进出口)
     */
    private String dataType;

    /**
     * 数据源(day:日库,month:月库,external:外部数据)
     */
    private String dataSource;

    /**
     * 
     */
    private Date createTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DailyData other = (DailyData) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCustomsClearanceDate() == null ? other.getCustomsClearanceDate() == null : this.getCustomsClearanceDate().equals(other.getCustomsClearanceDate()))
            && (this.getCommodityId() == null ? other.getCommodityId() == null : this.getCommodityId().equals(other.getCommodityId()))
            && (this.getCommodityName() == null ? other.getCommodityName() == null : this.getCommodityName().equals(other.getCommodityName()))
            && (this.getCommodityCode() == null ? other.getCommodityCode() == null : this.getCommodityCode().equals(other.getCommodityCode()))
            && (this.getDeclareCustomsId() == null ? other.getDeclareCustomsId() == null : this.getDeclareCustomsId().equals(other.getDeclareCustomsId()))
            && (this.getEntryExitCustomsId() == null ? other.getEntryExitCustomsId() == null : this.getEntryExitCustomsId().equals(other.getEntryExitCustomsId()))
            && (this.getRegionId() == null ? other.getRegionId() == null : this.getRegionId().equals(other.getRegionId()))
            && (this.getCountryId() == null ? other.getCountryId() == null : this.getCountryId().equals(other.getCountryId()))
            && (this.getEnterpriseId() == null ? other.getEnterpriseId() == null : this.getEnterpriseId().equals(other.getEnterpriseId()))
            && (this.getTradeModeId() == null ? other.getTradeModeId() == null : this.getTradeModeId().equals(other.getTradeModeId()))
            && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
            && (this.getQuantity() == null ? other.getQuantity() == null : this.getQuantity().equals(other.getQuantity()))
            && (this.getCurrencyType() == null ? other.getCurrencyType() == null : this.getCurrencyType().equals(other.getCurrencyType()))
            && (this.getDataType() == null ? other.getDataType() == null : this.getDataType().equals(other.getDataType()))
            && (this.getDataSource() == null ? other.getDataSource() == null : this.getDataSource().equals(other.getDataSource()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCustomsClearanceDate() == null) ? 0 : getCustomsClearanceDate().hashCode());
        result = prime * result + ((getCommodityId() == null) ? 0 : getCommodityId().hashCode());
        result = prime * result + ((getCommodityName() == null) ? 0 : getCommodityName().hashCode());
        result = prime * result + ((getCommodityCode() == null) ? 0 : getCommodityCode().hashCode());
        result = prime * result + ((getDeclareCustomsId() == null) ? 0 : getDeclareCustomsId().hashCode());
        result = prime * result + ((getEntryExitCustomsId() == null) ? 0 : getEntryExitCustomsId().hashCode());
        result = prime * result + ((getRegionId() == null) ? 0 : getRegionId().hashCode());
        result = prime * result + ((getCountryId() == null) ? 0 : getCountryId().hashCode());
        result = prime * result + ((getEnterpriseId() == null) ? 0 : getEnterpriseId().hashCode());
        result = prime * result + ((getTradeModeId() == null) ? 0 : getTradeModeId().hashCode());
        result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
        result = prime * result + ((getQuantity() == null) ? 0 : getQuantity().hashCode());
        result = prime * result + ((getCurrencyType() == null) ? 0 : getCurrencyType().hashCode());
        result = prime * result + ((getDataType() == null) ? 0 : getDataType().hashCode());
        result = prime * result + ((getDataSource() == null) ? 0 : getDataSource().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", customsClearanceDate=").append(customsClearanceDate);
        sb.append(", commodityId=").append(commodityId);
        sb.append(", commodityName=").append(commodityName);
        sb.append(", commodityCode=").append(commodityCode);
        sb.append(", declareCustomsId=").append(declareCustomsId);
        sb.append(", entryExitCustomsId=").append(entryExitCustomsId);
        sb.append(", regionId=").append(regionId);
        sb.append(", countryId=").append(countryId);
        sb.append(", enterpriseId=").append(enterpriseId);
        sb.append(", tradeModeId=").append(tradeModeId);
        sb.append(", amount=").append(amount);
        sb.append(", quantity=").append(quantity);
        sb.append(", currencyType=").append(currencyType);
        sb.append(", dataType=").append(dataType);
        sb.append(", dataSource=").append(dataSource);
        sb.append(", createTime=").append(createTime);
        sb.append("]");
        return sb.toString();
    }
}